<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace Plugin\Attractions\Inspection\Request\Inspection_plans;

use Hyperf\Validation\Request\FormRequest;

/**
 * 日常巡检计划验证数据类
 */
class InspectionPlansRequest extends FormRequest
{

    public function authorize(): bool
    {
        return true;
    }


    /**
     * 新增数据验证规则
     * return array
     */
    public function rules(): array
    {
        return [
            //巡检周期 1每日、2每周、3每月 验证
            'cycle' => 'required',
            //巡检人 验证
            'person' => 'required',
            //巡检设备 验证
            'devices' => 'required',
            'name' => 'required',

        ];
    }


    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => 'ID',
            'cycle' => '巡检周期 1每日、2每周、3每月',
            'person' => '巡检人',
            'devices' => '巡检设备',
            'name' => '计划名称',

        ];
    }

public function messages(): array
{
    return [
            'id.required' => '必填ID',
            'cycle.required' => '必填巡检周期 1每日、2每周、3每月',
            'person.required' => '必填巡检人',
            'devices.required' => '必填巡检设备',
            'name.required' => '必填计划名称',

    ];
}
}